import PyQt5.QtChart as chart
import pandas as pd
from PyQt5.QtCore import *

def genLine(x,y,name):
    # 折线
    series_1 = chart.QLineSeries()  # 定义LineSerise，将类QLineSeries实例化
    point_list=[]
    for i in range(len(x)):
        pos=QPointF(x[i],y[i])
        point_list.append(pos)
    series_1.append(point_list)  # 折线添加坐标点清单
    series_1.setName(name)  # 折线命名

    return series_1


def load(filename):
    data = pd.read_excel(filename)
    return data,data.columns.tolist()


def getCol(name,data):
    return data[name].values
